Q: The Music Kit's Partials class has a variable called freqRatios, which is an array of doubles. But the class description makes it sound as though these should be assigned integral values (like 1.0, 2.0, 3.0, etc.) . Can you assign them fractional values like 1.3, in order to synthesize sounds with inharmonic spectra? \
\
A:
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\fc0 The Partials object will accept non-integer values for the freqRatios array. However,
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fc0 the values are floored (changed to integers)
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\fc0 when the data is converted to sound samples
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fc0 es
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\fc0 ). Thus, for the most common use of the Partials object, you cannot get inharmonic partials.\
\
If you just want an inharmonic timbre and aren't concerned with the exact ratios, you can easily get one by using one of the FM SynthPatches, and setting its carrier/modulation ratio to be a non-integer. The easiest way to experiment is by playing in real time with the FM parameters in the Ensemble or BreakApp demos.\
\
The reason that the freqRatios array is a double is to support true additive synthesis. In this case, the Partials object is not converted to a wavetable for use as the lookup table of a single oscillator. Rather, the freqRatio, ampRatio, and phases arrays are accessed by the SynthPatch and used to determine the frequencies, amplitudes, and phases of a set of sine-wave oscillators. Additive synthesis is more "expensive," in that it uses many more oscillators per note (one for each partial), so you can't get as many simultaneous notes. The Music Kit doesn't currently provide such a SynthPatch, but one has been written and will soon be made available, probably on the archive servers. \
\
Also note that there's a bug with scaling in 2.0. If you ask a Partials object for a scaling of anything other than 0.0 (normalization), your samples will be N times too small, where N*2 is the length of the wavetable.\